const express = require('express');
const router = express.Router();
const { getBanners, addBanner, updateBanner, deleteBanner, upload } = require('../controllers/bannerController');

// 获取所有轮播图
router.get('/', getBanners);

// 添加轮播图（支持文件上传）
router.post('/', upload.single('image'), addBanner);

// 更新轮播图（支持文件上传）
router.put('/:id', upload.single('image'), updateBanner);

// 删除轮播图
router.delete('/:id', deleteBanner);

module.exports = router; 